<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>系统登录</title>
<script type="text/javascript">

	function check(){
		var flag=false;
		var username=document.getElementById("username").value;
		var password=document.getElementById("password").value;
		if(username.length<2 || password.length<2){
			alert("用户名和密码不符合要求，请重新输入！");			
		}else{
			flag=true;
		}
		return flag;		
	}
	

</script>
</head>
<body>
    <% String loginInfo=(String)request.getAttribute("loginInfo"); %>
	<h3 align="center">用户登录</h3>
	<form id="form1" action="user" method="post" onsubmit="return check();">
	    <input type="hidden" name="type" value="login">
		<table align="center" border="1">
			<tr>
				<td>用户名：</td>
				<td><input type="text" id="username" name="username"/></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input type="password" id="password" name="password" /></td>
			</tr>		
			<tr>
				<td colspan="2" align="center">
					<input type="submit" value="登录" />					
				</td>			
			</tr>
		</table>
		<%if(loginInfo!=null){ %>
		<h5 align="center" id="loginInfo"><%=loginInfo%></h5>
		<%} %>
	</form>
</body>
</html>